package com.woniuxy.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.mapper.RTMapper;
import com.woniuxy.mapper.RoomMapper;
import com.woniuxy.pojo.FindRoom;
import com.woniuxy.pojo.Room;
import com.woniuxy.pojo.RoomType;
import com.woniuxy.pojo.RoomType_dgy;
import com.woniuxy.pojo.Room_dgy;
import com.woniuxy.pojo.Room_yyh;
import com.woniuxy.service.RoomService;

@Service
@Transactional
public class RoomServiceImp implements RoomService {
	
	@Resource
	private RoomMapper roomMapper;
	
	@Resource
	private RTMapper rTMapper;

	@Override
	public List<Room> findByType(String roomType) {
		return roomMapper.findByType(roomType);
	}

	@Override
	public List<Room_yyh> getAll() {
		return roomMapper.getAll();
	}

	@Override
	public int updateR(Room room) {
		return roomMapper.updateR(room);
	}

	@Override
	public int deleteR(int rid) {
		return roomMapper.deleteR(rid);
	}

	@Override
	public int insertR(Room room) {
		return roomMapper.insertR(room);
	}

	@Override
	public List<Room> findTypeandfw() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Room> findStudents(FindRoom findRoom) {
		// TODO Auto-generated method stub
		return roomMapper.findStudents(findRoom);
	}

	@Override	
	public List<Room> findByState(String rstate) {
		return roomMapper.findByState(rstate);
	}

	@Override
	public Map<Integer, Integer> findRoomCount() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<RoomType> showType() {
		return rTMapper.showAll();
	}

	@Override
	public int insertR(RoomType roomType) {
		return rTMapper.add(roomType);
	}

	@Override
	public List<Room_yyh> selectR(String message) {
		return roomMapper.selectR("%"+message+"%");
	}
	
	
	@Override
	public Room_dgy findById(int rid) {
		return roomMapper.findById(rid);
	}

	@Override
	public List<Room_dgy> findRoom(String checkIn, String checkOut) {
		return roomMapper.findRoom(checkIn,checkOut);
	}

	@Override
	public int updateRoomState(Room_dgy room) {
		return roomMapper.updateRoomState(room);
	}
	

	@Override
	public List<Room_dgy> findByType1(RoomType_dgy roomType) {
		return roomMapper.findByType1(roomType);
	}
	
	@Override
	public Room_dgy findone(int rid) {
		return roomMapper.findone(rid);
	}
}
